from math import comb

def qsum(n, k, p=0.1):
    q = 0
    for i in range(k + 1):
        q += comb(n, i) * (p ** i) * ((1 - p) ** (n - i))
    return q